home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1429 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. Path: stc06.ctd.ornl.gov!mbk
  2. From: mbk@jt3ws1.etd.ornl.gov (Kennel)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: type checking in C++ was Re: Hungarian notation
  5. Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  6. Date: 10 Jan 1996 23:45:43 GMT
  7. Organization: Oak Ridge National Lab, Oak Ridge, TN
  8. Message-ID: <4d1j37$ge8@stc06.ctd.ornl.gov>
  9. References: <4cf8hf$8fe@hopi.gate.net> <DKoBrn.CHs@falcon.daytonoh.attgis.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: jt3ws1.etd.ornl.gov
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Dick Menninger (Dick.Menninger@DaytonOH.ATTGIS.COM) wrote:
  15. > Imbedding type information in a name had some utility
  16. > in the older C environments with the weak type checking
  17. > and very poor tools (no way to click on a variable and
  18. > find out the minutae of its implementation).  Even there,
  19. > a price was paid that required C lexical recognizing
  20. > translation (old name to new name) tools to ease evolution
  21. > messes that resulted.  The imbedding of type information
  22. > in variable names is really a poor substitute for good
  23. > documentation and tools.
  24.  
  25. > The purpose of C++ in its design
  26. > and evolution has been to hide implementation while
  27. > providing genuinely heavy duty compile-time type checking.
  28.  
  29.  
  30. Is the goal actually achieved?  "heavy duty compile-time type-checking?"
  31.  
  32. At one point something like this could be a problem.  It it still?
  33.  
  34. function(Type *p) {
  35.  
  36. // One of this may silently crash or do bad things.  Both typecheck. 
  37.  
  38. //    delete p;
  39. //    delete [] p; 
  40.  
  41. }
  42.  
  43. The response is "but that isn't a type error" is an attempt to 
  44. define away the real problem, which is that pointers to single objects
  45. and references to built-in arrays of value objects are not always distinct
  46. types, in contrast to other currently existing languages which do 
  47. "heavier duty compile-time typechecking".
  48.  
  49. Taking such an argument to absurd limits one could argue that Smalltalk does 
  50. heavy-duty compile-time type-checking, but all programs pass type-checking
  51. automatically because there is but one compile-time type for variables. 
  52.  
  53. cheerio
  54. matt
  55.  
  56.  
  57. > Good Day
  58. > Dick
  59. > Dick.Menninger@DaytonOH.ATTGIS.COM
  60.  
  61.